package business.service.delegate
{
	import com.adobe.cairngorm.business.ServiceLocator;
	import mx.rpc.IResponder;
	import mx.rpc.remoting.RemoteObject;
	import valueObjects.Product;
	import valueObjects.User;
	
	public class BusinessAMDelegate
	{
		private var responder:IResponder;
		private var remoteObject:RemoteObject;
		public function BusinessAMDelegate(responder:IResponder)
		{
			this.responder = responder;
			this.remoteObject = ServiceLocator.getInstance().getRemoteObject("myRemoteBusinessAM");
		}
		public function getAllProducts():void {
			var call:Object = remoteObject.getAllProducts();
			call.addResponder(responder);
		}
		public function getProductByProductId(productId:String):void {
			var call:Object = remoteObject.getProductByProductId(productId);
			call.addResponder(responder);
		}
		public function registerUser(user:User):void {
			var call:Object = remoteObject.registerUser(user);
			call.addResponder(responder);
		}
		public function getUserByUserId(userId:String):void {
			var call:Object = remoteObject.getUserByUserId(userId);
			call.addResponder(responder);
		}
		public function validateUser(user:User):void {
			var call:Object = remoteObject.validateUser(user);
			call.addResponder(responder);
		}
		
		
	}
}